Singapore Math Olympiad Question